from openpyxl import load_workbook
from openpyxl.styles import Font
workbook = load_workbook('F:\\python\\第5章\\出库表2.xlsx')
worksheet = workbook['Sheet1']
area1 = worksheet['A2:E2']
font1 = Font(name='微软雅黑', size=12, bold=True, italic=False, color='000000')
area2 = worksheet['A3:A16']
font2 = Font(name='华文中宋', size=10, bold=True, italic=True, color='FF0000')
area3 = worksheet['B3:E16']
font3 = Font(name='华文楷体', size=10, bold=False, italic=False, color='000000')
for i in area1:
    for j in i:
        j.font = font1
for i in area2:
    for j in i:
        j.font = font2
for i in area3:
    for j in i:
        j.font = font3
workbook.save('F:\\python\\第5章\\出库表3.xlsx')
